<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%  
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
request.setAttribute("path", basePath);  
%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0 ,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>结算页面</title>

		<link href="<%=path %>/web/assets/css/amazeui.css" rel="stylesheet" type="text/css" />

		<link href="<%=path %>/web/basic/css/demo.css" rel="stylesheet" type="text/css" />
		<link href="<%=path %>/web/css/cartstyle.css" rel="stylesheet" type="text/css" />

		<link href="<%=path %>/web/css/jsstyle.css" rel="stylesheet" type="text/css" />
       <script type="text/javascript" src="<%=path%>/web/js/jquery-2.2.4.js"></script>
		<script type="text/javascript" src="<%=path %>/web/js/address.js"></script>
		<script type="text/javascript" src="<%=path %>/web/js/myJQuery.js"></script>
       <script type="text/javascript">
       
      
			function submit(){
				//alert("111");
				$("#addressForm").submit();
		 	}
			
			</script>
	</head>

	<body>
			<div class="clear"></div>
			<div class="concent">
				<!--地址 -->
				<div class="paycont">
					<div class="address">
						<h3>确认收货地址 </h3>
						<div class="control">
							<div class="tc-btn createAddr theme-login am-btn am-btn-danger">使用新地址</div>
						</div>
						<div class="clear"></div>
						<ul>
							<div class="per-border"></div>							
							
						
						
							
							<div class="per-border"></div>
								<c:forEach items="${requestScope.addLists}" var="a">
		     				<li class="user-addresslist">
								<div class="address-left">
									<div class="user DefaultAddr">

										<span class="buy-address-detail">   
                                         <span class="buy-user">${a.name }</span>
										<span class="buy-phone">${a.phone }</span>
										</span>
									</div>
									<div class="default-address DefaultAddr">
										<span class="buy-line-title buy-line-title-type">收货地址：</span>
										<span class="buy--address-detail">
								        <span class="street">${a.address }</span>
								        <!-- <span class="province">湖北</span>省
										<span class="city">武汉</span>市
										<span class="dist">洪山</span>区 -->
										<span class="street">${a.addDetail }</span>
										</span>

										</span>
									</div>
								
								</div>
								<div class="address-right">
									<span class="am-icon-angle-right am-icon-lg"></span>
								</div>
								<div class="clear"></div>
                                ${a.flag}
								<div class="new-addr-btn">
									 <c:choose>
									   <c:when test="${a.flag==1}">
									        <a href="#" class="hidden">默认地址</a>
									   </c:when>
									   <c:otherwise>
									       <a href="#">设为默认</a>
									   </c:otherwise>
									</c:choose>
									<span class="new-addr-bar">|</span>
									<a href="<%=path %>/adrs/queryAddById.do?id=${a.id}" target="mainPer">编辑</a>
									<span class="new-addr-bar">|</span>
									<a href="javascript:void(0);"  onclick="delClick(${a.id});">删除</a>
								</div>

							</li>
                          </c:forEach>
						</ul>

						<div class="clear"></div>
					</div>
				
					
					</div>
				</div>
				
			
			<div class="theme-popover-mask"></div>
			<div class="theme-popover">

				<!--标题 -->
				<div class="am-cf am-padding">
					<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">新增地址</strong> / <small>Add address</small></div>
				</div>
				<hr/>

				<div class="am-u-md-12">
					<form id="addressForm" class="am-form am-form-horizontal" action="<%=path %>/adrs/addAddress.do" method="post">

						<div class="am-form-group">
							<label for="user-name" class="am-form-label">收货人</label>
							<div class="am-form-content">
								<input type="text" id="name" placeholder="收货人" name="name"/>
							</div>
						</div>

						<div class="am-form-group">
							<label for="user-phone" class="am-form-label">手机号码</label>
							<div class="am-form-content">
								<input type="text" id="phone" placeholder="手机号必填"  name="phone">
							</div>
						</div>

						<div class="am-form-group">
							<label for="user-phone" class="am-form-label">所在地</label>
							<div class="am-form-content">
								<input type="text" id="address" placeholder="所在地"  name="address">
							</div>
							<!-- <div class="am-form-content address">
								<select data-am-selected name="address">
									<option value="1">浙江省</option>
									<option value="1">湖北省</option>
								</select>
								<select data-am-selected>
									<option value="a">温州市</option>
									<option value="b">武汉市</option>
								</select>
								<select data-am-selected>
									<option value="a">瑞安区</option>
									<option value="b">洪山区</option>
								</select>
							</div> -->
						</div>
                        <input type="hidden" name="userId" id="userId" value="${userInfoSession.id }"/>
						<div class="am-form-group">
							<label for="user-intro" class="am-form-label">详细地址</label>
							<div class="am-form-content">
							<!-- <input type="text" id="addDetail" name="addDetail" placeholder="输入详细地址"/> -->
								<textarea class="" rows="3" id="addDetail" name="addDetail" placeholder="输入详细地址"></textarea>
								<small>100字以内写出你的详细地址...</small>
							</div>
						</div>
                       
						<div class="am-form-group theme-poptit">
							<div class="am-u-sm-9 am-u-sm-push-3">
								<div class="am-btn am-btn-danger"><p onclick="submit()">保存</p></div>
								<div class="am-btn am-btn-danger close">取消</div>
							</div>
						</div>
					</form>
				</div>

			</div>

			<div class="clear"></div>
			
	</body>

</html>